Skip to content

ios: Fix Error checking for SecRandomCopyBytes#244

Merged
newpavlov merged 1 commit intomasterfrom
ios
Jan 21, 2022
Merged

ios: Fix Error checking for SecRandomCopyBytes#244
newpavlov merged 1 commit intomasterfrom
ios

Conversation

@josephlr
Copy link
Copy Markdown
Member

Apple's documentation for SecRandomCopyBytes says that errSecSuccess is
returned on success, and all other values indicate failure.
https://developer.apple.com/documentation/security/1399291-secrandomcopybytes

The SecBase.h header also clearly establishes that errSecSuccess = 0:
https://opensource.apple.com/source/Security/Security-55471/sec/Security/SecBase.h.auto.html

Fixes #243

Signed-off-by: Joe Richey joerichey@google.com

Apple's documentation for SecRandomCopyBytes says that errSecSuccess is
returned on success, and all other values indicate failure.
  https://developer.apple.com/documentation/security/1399291-secrandomcopybytes

The SecBase.h header also clearly establishes that `errSecSuccess = 0`:
  https://opensource.apple.com/source/Security/Security-55471/sec/Security/SecBase.h.auto.html

Fixes #243

Signed-off-by: Joe Richey <joerichey@google.com>
@newpavlov newpavlov merged commit 21e03e8 into master Jan 21, 2022
@newpavlov newpavlov deleted the ios branch January 21, 2022 16:50
henrysun007 pushed a commit to mesatee/getrandom that referenced this pull request Nov 24, 2022
Apple's documentation for SecRandomCopyBytes says that errSecSuccess is
returned on success, and all other values indicate failure.
  https://developer.apple.com/documentation/security/1399291-secrandomcopybytes

The SecBase.h header also clearly establishes that `errSecSuccess = 0`:
  https://opensource.apple.com/source/Security/Security-55471/sec/Security/SecBase.h.auto.html

Fixes rust-random#243

Signed-off-by: Joe Richey <joerichey@google.com>
takumi-earth pushed a commit to earthlings-dev/getrandom that referenced this pull request Jan 27, 2026
Apple's documentation for SecRandomCopyBytes says that errSecSuccess is
returned on success, and all other values indicate failure.
  https://developer.apple.com/documentation/security/1399291-secrandomcopybytes

The SecBase.h header also clearly establishes that `errSecSuccess = 0`:
  https://opensource.apple.com/source/Security/Security-55471/sec/Security/SecBase.h.auto.html

Fixes rust-random#243

Signed-off-by: Joe Richey <joerichey@google.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

iOS SecRandomCopyBytes ret checking suggestion

2 participants